import math

n = int(input())
nums = list(map(int, input().split()))
ans = 0
for i in range(1, n):
    if nums[i] >= nums[i - 1]: continue
    cnt = math.ceil(math.log2(nums[i - 1] / nums[i]))
    nums[i] *= pow(2, cnt)
    ans += cnt
print(ans)
